<?php
class LocationContain_Form_LocationContain_Update extends Zend_Form
{
	public function __construct(Zend_Controller_Action $controller)
	{
		//location_contain_location_code
		$location_contain_location_code = $this->createElement ( 'select', 'location_contain_location_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_contain_location_code' ))
		->setDescription ( $controller->getHelper('common')->getDescription('location_contain_location_code' ))
		->setRequired(true)
		;
		
		//location_contain_product_code
		$location_contain_product_code = $this->createElement ( 'select', 'location_contain_product_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_contain_product_code' ))
		->setDescription ( $controller->getHelper('common')->getDescription('location_contain_product_code' ))
		->setRequired(true)
		;
		
		//location_contain_max
		$location_contain_max = $this->createElement ( 'text', 'location_contain_max' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_contain_max' ))
		->setDescription ( $controller->getHelper('common')->getDescription('location_contain_max' ))
		->addValidator ( 'Int', TRUE )
		->addValidator ( 'GreaterThan', TRUE, array( 0 ) )
		->setAttrib ( 'class','numeric' )
		->setRequired(true)
		;
		
		//location_contain_unit_code
		$location_contain_unit_code = $this->createElement ( 'select', 'location_contain_unit_code' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_contain_unit_code' ))
		->setDescription ( $controller->getHelper('common')->getDescription('location_contain_unit_code' ))
		->setRequired(true)
		;
		
		//location_contain_status
		$location_contain_status = $this->createElement ( 'radio', 'location_contain_status' )
		->setLabel ( $controller->getHelper('common')->getCaption('location_contain_status' ))
		->setDescription ( $controller->getHelper('common')->getDescription('location_contain_status' ))
		->setMultiOptions(array(1=>'Kích hoạt',0=>'Vô hiệu'))
		->setValue(1)
		;
		
		$this->addElements ( array (
			//$location_contain_location_code,
			$location_contain_product_code,
			$location_contain_max,
			$location_contain_unit_code,
			$location_contain_status,
		) );	
		
		$controller->getHelper ( 'common' )->form ( $this );
	}
}